package org.apache.commons.pool2;

/**
 * 类的描述
 *
 * @author ztkool
 * @version v
 */
public abstract class BaseKeyedPooledObjectFactory<K, V> extends BaseObject implements KeyedPooledObjectFactory<K, V> {

    public abstract V create(K object) throws Exception;

    public abstract PooledObject<V> wrap(V object);

    @Override
    public PooledObject<V> makeObject(K key) throws Exception {
        return this.wrap(this.create(key));
    }

    @Override
    public void destroyObject(K key, PooledObject<V> p) throws Exception {
    }

    @Override
    public boolean validateObject(K key, PooledObject<V> p) {
        return true;
    }

    @Override
    public void activateObject(K key, PooledObject<V> p) throws Exception {
    }

    @Override
    public void passivateObject(K key, PooledObject<V> p) throws Exception {
    }

}
